#ifndef EXAMPLE_H
#define EXAMPLE_H

/*
 ******************************
 * Object Oriented Programming in C
 *
 * Author: Laurent Deniau, Laurent.Deniau@cern.ch
 *
 * For more information, please see the paper:
 * http://home.cern.ch/ldeniau/html/oopc/oopc.html
 *
 ******************************
 */

#include <ooc.h>

/*
  Example of inheritance in OOPC:
  K --> J --> F
          --> G --> C --> A
                      --> B
          --> H --> D
                --> E --> B
          --> I
*/

#define BASEINTER		\
BASEOBJECT_INTERFACE		\
BASEOBJECT_METHODS		\
ENDOF_INTERFACE			\
CLASSINTER

#define CLASSINTER		\
ABSTRACTCLASS_INTERFACE		\
ENDOF_INTERFACE

#undef  OBJECT
#define OBJECT A

BASEINTER

#undef  OBJECT
#define OBJECT B

BASEINTER

#undef  OBJECT
#define OBJECT C

OBJECT_INTERFACE
  INHERIT_MEMBERS_OF(A);
  INHERIT_MEMBERS_OF(B);
OBJECT_METHODS
  INHERIT_METHODS_OF(A);
  INHERIT_METHODS_OF(B);
ENDOF_INTERFACE

CLASSINTER

#undef  OBJECT
#define OBJECT D

BASEINTER

#undef  OBJECT
#define OBJECT E

OBJECT_INTERFACE
  INHERIT_MEMBERS_OF(B);
OBJECT_METHODS
  INHERIT_METHODS_OF(B);
ENDOF_INTERFACE

CLASSINTER

#undef  OBJECT
#define OBJECT F

BASEINTER

#undef  OBJECT
#define OBJECT G

OBJECT_INTERFACE
  INHERIT_MEMBERS_OF(C);
OBJECT_METHODS
  INHERIT_METHODS_OF(C);
ENDOF_INTERFACE

CLASSINTER

#undef  OBJECT
#define OBJECT H

OBJECT_INTERFACE
  INHERIT_MEMBERS_OF(D);
  INHERIT_MEMBERS_OF(E);
OBJECT_METHODS
  INHERIT_METHODS_OF(D);
  INHERIT_METHODS_OF(E);
ENDOF_INTERFACE

CLASSINTER

#undef  OBJECT
#define OBJECT I

BASEINTER

#undef  OBJECT
#define OBJECT J

OBJECT_INTERFACE
  INHERIT_MEMBERS_OF(F);
  INHERIT_MEMBERS_OF(G);
  INHERIT_MEMBERS_OF(H);
  INHERIT_MEMBERS_OF(I);
OBJECT_METHODS
  INHERIT_METHODS_OF(F);
  INHERIT_METHODS_OF(G);
  INHERIT_METHODS_OF(H);
  INHERIT_METHODS_OF(I);
ENDOF_INTERFACE

CLASSINTER

#undef  OBJECT
#define OBJECT K

OBJECT_INTERFACE
  INHERIT_MEMBERS_OF(J);
OBJECT_METHODS
  INHERIT_METHODS_OF(J);
ENDOF_INTERFACE

CLASS_INTERFACE
ENDOF_INTERFACE

#endif
